﻿using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Text;
using Portal.Environment;
using Portal.Language;
using Portal.Interface;

namespace Portal.CMS
{
    public class WfPublishingNews : WorkflowFunctionInt
    {
        public string Id
        {
            get
            {
                return "WfPublishingNews";
            }
        }
        public string Name
        {
            get
            {
                return "Phát hành tin tức lên website";
            }
        }

        public object Execute(WorkFlowLibrary.WorkFlowApp wf, WorkFlowLibrary.Model.WorkFlowRecordCls wfRecordCls, string Id)
        {
            //tao o day....!
            try
            {
                Environments.CheckSessionTimeOut(true);
                new NewsBLL().PublishingPublicWebSite(wfRecordCls.Id);
                return ResourceBLL.GetText("WfPublishingNews", "PublishingOk", "Xuất bản tin lên web thành công!");
            }
            catch (Exception ex)
            {
                return "ERROR: " + ex.Message.ToString();
            }
        }
    }
}
